package com.example.interview.no0101.solution;

import com.example.interview.no0101.Solution;

/**
 * @Description 解答-判定字符是否唯一
 * @ClassName SolutionImpl
 * @Author Administrator
 * @Date 2020/5/20 10:26
 * @Version 1.0.0
 */
public class IndexSolutionImpl implements Solution {

    @Override
    public boolean isUnique(String str) {
        for (char ch: str.toCharArray()){
            if (str.indexOf(ch) != str.lastIndexOf(ch)) {
                return false;
            }
        }
        return true;
    }
}
